﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>

<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>ChkInfoClsTree</title>
      @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
        @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
        )
            @Html.DevExpress().GetScripts(
                new Script { ExtensionType = ExtensionType.ListBox }
        )
        <script>
            function MenuTop_emClick(source, e) {
                switch (e.item.name) {
                    case "btnAdd":
                        {
                            var obj = ASPxClientTreeView.Cast("LeftTreeView");
                            var a = obj.GetSelectedNode();
                            window.returnValue = "";
                            window.close();
                            break;
                        }
                    case "btnCancel":
                        {
                            this.close();
                            break;
                        }
                }
            }
        </script>
</head>
<body>
<div class="floatToolMenu" id="toolMenu">
        @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnAdd";
               item.Text = "确定";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");
           });
           settings.Items.Add(item =>
           {
               item.Name = "btnCancel";
               item.Text = "取消";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/cancel.png");
           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
    </div>

  <div class="leftPanel">
        @Html.DevExpress().TreeView(settings =>
{
    settings.Name = "LeftTreeView";
    settings.ShowTreeLines = true;
    settings.AllowSelectNode = true;
    settings.NameField = "Id";
    settings.TextField = "Name";
    settings.ImageUrlField = "ImageUrl";
    settings.PreRender = (source, e) =>
    {
        ASPxTreeView treeView = (ASPxTreeView)source;
        treeView.ExpandAll();
    };

}).Bind(Model).GetHtml()
    </div>

    <script>
        lp.Hide();
    </script>
</body>
</html>
